/*
 * @Author: chentao 
 * @Date: 2019-05-04 00:19:56 
 * @Last Modified by: chentao
 * @Last Modified time: 2019-11-03 12:59:51
 */
import React from 'react';
import { AppRegistry } from 'react-native';

import dva from './utils/dva';
import Router, { routerMiddleware } from './router';
import models from './configs/ModelConfig';

// 关闭警告
console.disableYellowBox = true;
console.warn('YellowBox is disabled.');

// disable console. log in production
if (!__DEV__) {
  global.console = {
    info: () => {},
    log: () => {},
    warn: () => {},
    debug: () => {},
    error: () => {}
  };
}

const app = dva({
  initialState: {},
  models: models,
  onAction: [routerMiddleware],
  onError(e) {
    e.preventDefault();
    console.log('onError', e);
  }
});

const App = app.start(<Router />);

AppRegistry.registerComponent('RNOneKeyBuyCoins', () => App);

export default app._store;
